package flatlandRPG;
import org.lwjgl.util.vector.Vector2f;

/**
 *  The most basic game-object. Contains methods and fields common to all
 *  objects in the game. All possible objects will have a location and an
 *  orientation, i.e. physical objects and trigger areas. Also, all objects
 *  will have a means of displaying themselves in-game, including invisible
 *  objects such as triggers or logic controllers for debugging purposes.
 *  All objects will have some means of thinking and interacting with
 *  the world around them.
 *
 *  @author carlos
 *  @version Apr 3, 2011
 */
public abstract class Entity
{
    /**
     * The location of the entity
     */
    private Vector2f location;

    /**
     * Create a new entity at the origin
     */
    public Entity()
    {
        location = new Vector2f(0.0f, 0.0f);
    }

    /**
     * Getter method for the location of the Entity
     * @return The location of the Entity
     */
    public Vector2f getLocation()
    {
        return location;
    }

    // ----------------------------------------------------------
    /**
     * Returns the x position of the object.
     *
     * @return the x position
     */
    public float getX()
    {
        return location.getX();
    }


    // ----------------------------------------------------------
    /**
     * Sets the x position of the object.
     *
     * @param x
     *            the x position
     */
    public void setX(float x)
    {
        location.setX(x);
    }


    /**
     * Returns the y position of the object.
     *
     * @return the y position
     */
    public float getY()
    {
        return location.getY();
    }


    /**
     * Sets the y position of the object.
     *
     * @param y
     *            the y position
     */
    public void setY(float y)
    {
        location.setY(y);
    }

    /**
     * Sets the Entity's location to a new location
     * @param location A new location
     */
    public void setLocation(Vector2f location)
    {
        this.location = location;
    }


}
